﻿<phone:PhoneApplicationPage 
    x:Class="WeiboPlus.Shell.Views.MainView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    xmlns:delay="clr-namespace:Delay;assembly=PhonePerformance"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    d:DataContext="{d:DesignData /SampleData/MainViewModelSampleData.xaml}"
    SupportedOrientations="Portrait" 
    shell:SystemTray.IsVisible="False" Orientation="None">
    <Grid x:Name="LayoutRoot" Background="{StaticResource BackroundBrush}" >
        <Grid VerticalAlignment="Stretch" Visibility="{Binding HasBindedAccount,Converter={StaticResource BoolToVisibilityConverter}}" Margin="0,0,0,30">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock x:Name="title" Foreground="White" Text=" " FontSize="28" Margin="20,10"/>
            <!--一张牌占卜未来<ListBox Grid.Row="1" ScrollViewer.ManipulationMode="System" VerticalAlignment="Top" HorizontalAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Disabled" Padding="-2"  ScrollViewer.HorizontalScrollBarVisibility="Auto" Height="300" ItemsSource="{Binding Items}" >
                <ListBox.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Margin="10" >
                            <Image Source="{Binding BackImage}" Height="280" Width="160" Stretch="Fill" Tap="Image_Tap" >
                                <Image.Clip>
                                    <RectangleGeometry
                            RadiusX="14"
                            RadiusY="14"
                            Rect="0,0,160,280" />
                                </Image.Clip>
                            </Image>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>-->
            <Canvas x:Name="canvas" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Image Tap="Image_Tap" Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="168" Canvas.Top="58" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="166" Canvas.Top="56" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="164" Canvas.Top="54" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="162" Canvas.Top="52" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="162" Canvas.Top="52" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="170" Canvas.Top="60" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="168" Canvas.Top="58" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="166" Canvas.Top="56" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="164" Canvas.Top="54" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="162" Canvas.Top="52" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
                <Image Tap="Image_Tap"  Canvas.Left="160" Canvas.Top="50" Source="/Images/Cards/backside.jpg" Height="280" Width="160" Stretch="Fill">
                    <Image.Clip>
                        <RectangleGeometry
                            RadiusX="16"
                            RadiusY="16"
                            Rect="0,0,160,280" />
                    </Image.Clip>
                </Image>
            </Canvas>
            <TextBlock x:Name="label" VerticalAlignment="Bottom" Grid.Row="1" Foreground="White" HorizontalAlignment="Center" Margin="40,10,40,20" TextWrapping="Wrap" FontSize="22"/>
            <!--<ScrollViewer Grid.RowSpan="2">
                <Image VerticalAlignment="Top" Width="320" Height="540" x:Name="cardImage"/>
            </ScrollViewer>-->
                <Button Grid.Row="2" x:Name="btnShuffle" Click="btnShuffle_Click" Content="洗牌" Width="300" BorderThickness="0" Margin="10,0" Foreground="White" Background="SeaGreen" />
        </Grid>

        <Grid Visibility="{Binding HasBindedAccount,Converter={StaticResource ReverseBoolToVisibilityConverter}}"   HorizontalAlignment="Stretch" Margin="200,620,-10,20" VerticalAlignment="Top" x:Name="addNewGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
            </Grid.RowDefinitions>
            <!--<Border Grid.Row="0" Grid.RowSpan="2" Style="{StaticResource NewAccountGridBorderStyle}" d:LayoutOverrides="GridBox"/>-->
            <Button ClickMode="Release" FontSize="28" HorizontalAlignment="Stretch" Background="SeaGreen" Foreground="White" Content="新浪微博授权" Padding="12,8"  Name="AuthorizeButton" BorderThickness="0" Command="{Binding Authorize}"/>
        </Grid>
        <toolkit:PerformanceProgressBar x:Name="progressIndicator" Foreground="SeaGreen" IsIndeterminate="{Binding Loading}" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
        <!--<Grid Background="Black" Opacity=".5" Visibility="{Binding ShowQuickSetting,Converter={StaticResource BoolToVisibilityConverter}}" >
        </Grid>-->
    </Grid>

    <!--Sample code showing usage of ApplicationBar
                     <shell:ApplicationBarMenuItem Click="search_Click" Text="搜索话题" />-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar Mode="Minimized" IsVisible="False" IsMenuEnabled="True" Opacity=".5">
            <shell:ApplicationBar.MenuItems>
                <!--
                shell:ApplicationBarMenuItem Click="account_management_Click"  Text="账号管理" />-->
                <shell:ApplicationBarMenuItem Click="reviewItem_Click" Text="打分评价" />
                <shell:ApplicationBarMenuItem Click="share_Click" Text="分享" />
                
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>
